const state = {
  userInfo: null
}

const mutations = {
  SET_USER_INFO(state, value){
    if(typeof value !== 'object'){
      throw new Error('userInfo is not an object')
    }
    state.userInfo = value
  }
}

const actions = {
  setUserInfo({ commit }, value){
    commit('SET_USER_INFO', value)
  }
}

export default {
  state,
  mutations,
  actions
}
